home *** CD-ROM | disk | FTP | other *** search
/ PsL Monthly 1994 January / PSL Monthly Shareware CD-ROM (Public Software Library) (January 1994).iso / games / dos / board / backgam.com / BKG.DOC < prev    next >
Encoding:
Text File  |  1987-01-12  |  31.5 KB  |  671 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9.  
  10.  
  11.  
  12.  
  13.  
  14.  
  15.  
  16.  
  17.                            Backgammon
  18.  
  19.                                by
  20.  
  21.                           Bill Mahoney
  22.                          7610 Redick Ave
  23.                      Omaha, Nebraska  68122
  24.  
  25.  
  26. The game of backgammon has been around for centuries. However, it 
  27. is  still  a popular game today, and it is one that I  play  from 
  28. time  to time. Since I am involved with computer software  daily, 
  29. I thought the game might be an interesting one to implement on  a 
  30. computer. BKG is the result of my efforts. The program may not be 
  31. the  most  elegant  implementation, and it may not  be  the  best 
  32. player  of the game. But I must be a hacker at heart, because  my 
  33. intention  when I started this "pet project" was not so  much  to 
  34. construct  a great backgammon theorist, but rather to  have  some 
  35. fun "teaching" a machine to play.
  36.  
  37. This  document is not intended as an instruction booklet  on  the 
  38. game.  There are so many good backgammon books available  at  any 
  39. local  bookstore  that  it  would be  silly  to  duplicate  their 
  40. efforts.  Thus,  I  assume  that  the  reader  has  at  least   a 
  41. rudimentary  understanding of the game. In order to  clarify  the 
  42. description of BKG, however, I have compiled the following  notes 
  43. on the terminology of play:
  44.  
  45. There are two players in the game, and they are usually  referred 
  46. to  as white and black. Each player has a number (15) of  men  on 
  47. the playing board, as shown below:
  48.  
  49.                           White's Side
  50.  
  51.       1   2   3   4   5   6           7   8   9  10  11  12
  52.     +-----------------------+-------+-----------------------+
  53.     | B                   W |       |     W               B |
  54.     | B                   W |       |     W               B |
  55.     |                     W |       |     W               B |
  56.     |                     W |       |                     B |
  57.     |                     W |       |                     B |
  58.     |                       |       |                       |
  59.     |                       |       |                       |
  60.     |                     B |       |                     W |
  61.     |                     B |       |                     W |
  62.     |                     B |       |     B               W |
  63.     | W                   B |       |     B               W |
  64.     | W                   B |       |     B               W |
  65.     +-----------------------+-------+-----------------------+
  66.      24  23  22  21  20  19          18  17  16  15  14  13
  67.  
  68.                           Black's Side
  69.  
  70. If you are already familiar with the game, you will note that the 
  71. board is drawn with respect to black's side. I will use this side 
  72. for the "human" and BKG will play white.
  73.  
  74. In any case, the object of the game is to move your black players 
  75. from the low numbered points to the higher numbered points.  That 
  76. is,  in a clockwise direction. Meanwhile, white moves his  pieces 
  77. from the higher numbered points to the lower numbered points,  in 
  78. a   counter-clockwise   direction.  Neither   player   can   move 
  79. "backwards"  on the board. The first person to remove all of  his 
  80. men  from the board is the winner. A pair of dice is used to  de-
  81. termine  the moves that can be made. Needless to say, things  are 
  82. not quite as easy as they may look.
  83.  
  84. The dice that are used with backgammon relate the possible  moves 
  85. that  can be made. Rolling a 3 and a 5, for example,  would  mean 
  86. that  the  player  whose turn it is could move  one  man  3,  and 
  87. another man 5. The "other man" can be the same one, provided that 
  88. the moves are considered to be two separate moves - one of 3, and 
  89. one of five. If it makes any difference, the dice can be read  as 
  90. a  5  and a 3, as well. When a player rolls doubles,  he  or  she 
  91. makes four moves of that number. Double 3's, as an example, allow 
  92. a player to move four 3's anywhere on the board. Each player must 
  93. move  as  many moves as can be made! In some cases, this  is  not 
  94. desirable, but it is a rule (enforced by the software, also).
  95.  
  96. If  the object of the game is to remove your men from the  board, 
  97. how is this done? The first difficulty is that you must move  all 
  98. of  your men to your own inner table prior to taking them off  of 
  99. the  playing table. Black has an inner table from point 19 up  to 
  100. point 24. So, prior to black removing men from the table, all  of 
  101. the  black  players on the board must be between  number  19  and 
  102. number  24. Likewise, white has an inner table from 1 to  6,  and 
  103. all  of the white players must be in white's inner  table  before 
  104. they can be removed.
  105.  
  106. Another complicating matter is that men may be hit, placing  them  
  107. on  the bar. The bar is a sort of "limbo" for players  that  have 
  108. been  hit. It is the area between the two halves of  the  playing 
  109. table. Whenever white leaves one man on a number, that man can be 
  110. hit  by  black. Likewise, if the black player lets only  one  man 
  111. remain  on a number, he is vulnerable to being hit by  white.  In 
  112. order to hit a player, all that the opponent must do is place one 
  113. of his men on the same spot, and move the opponents player to the 
  114. bar. For example:
  115.  
  116.                           White's Side
  117.  
  118.       1   2   3   4   5   6           7   8   9  10  11  12
  119.     +-----------------------+-------+-----------------------+
  120.     | B                   W |       |     W               B |
  121.     | B                   W |       |     W               B |
  122.     |                     W |       |     W               B |
  123.     |                     W |       |                       |
  124.     |                     W |       |                       |
  125.     |                       |       |                       |
  126.     |                       |       |                       |
  127.     |                     B |       |                     W |
  128.     |                     B |       |                     W |
  129.     |                     B |       |     B               W |
  130.     |                     B |       |     B               W |
  131.     |             W       B |       | W   B   B   B       W |
  132.     +-----------------------+-------+-----------------------+
  133.      24  23  22  21  20  19          18  17  16  15  14  13
  134.  
  135.                           Black's Side
  136.  
  137. Suppose that white moves from point number 18 to point number 16:
  138.  
  139.                           White's Side
  140.  
  141.       1   2   3   4   5   6           7   8   9  10  11  12
  142.     +-----------------------+-------+-----------------------+
  143.     | B                   W |       |     W               B |
  144.     | B                   W |   B   |     W               B |
  145.     |                     W |       |     W               B |
  146.     |                     W |       |                       |
  147.     |                     W |       |                       |
  148.     |                       |       |                       |
  149.     |                       |       |                       |
  150.     |                     B |       |                     W |
  151.     |                     B |       |                     W |
  152.     |                     B |       |     B               W |
  153.     |                     B |       |     B               W |
  154.     |             W       B |       |     B   W   B       W |
  155.     +-----------------------+-------+-----------------------+
  156.      24  23  22  21  20  19          18  17  16  15  14  13
  157.  
  158.                           Black's Side
  159.  
  160. Note  that white is moving counter-clockwise, so this is a  legal 
  161. move to make. Once the black player on point number 16 is hit, he 
  162. is placed on the bar as shown. White has two points with only one 
  163. man  on  them,  point number 17 and point number  21.  The  black 
  164. player  could  conceivably  hit either of these white  men  on  a 
  165. future move. Except...
  166.  
  167. Once a man is placed on the bar, like the black man in the  above 
  168. example,  the player playing black must remove that  player  from 
  169. the  board before making any other move. The bar is like a  point 
  170. numbered 0 for black, or like a point numbered 25 for white.  (In 
  171. fact, the BKG program uses these numbers.) Thus, it is  necessary 
  172. to move the black player on the bar to one of the points numbered 
  173. 1 to 6, before any other move can be made.
  174.  
  175. These  examples have referred to points with only one  player  on 
  176. them.  What  about  points with other numbers? If  there  are  no 
  177. players  at  all on a point, then anyone can move to  that  point 
  178. with a proper roll of the dice. If there is one of your opponents 
  179. men  on a point, you can bump him onto the bar, as in  the  above 
  180. example. Unfortunately, if your opponent has more than one player 
  181. on a point, you are not allowed to move to that point.
  182.  
  183. Consider this example:
  184.  
  185.                           White's Side
  186.  
  187.       1   2   3   4   5   6           7   8   9  10  11  12
  188.     +-----------------------+-------+-----------------------+
  189.     |         W   W       W |       | B   W       W       B |
  190.     |                     W |       | B   W               B |
  191.     |                     W |       |     W                 |
  192.     |                       |       |     W                 |
  193.     |                       |       |                       |
  194.     |                       |       |                       |
  195.     |                       |       |                       |
  196.     |                     B |       |                       |
  197.     |                     B |       |                       |
  198.     |                     B |       |     B               W |
  199.     |                     B |       |     B   B           W |
  200.     |             W       B |       | W   B   B       B   W |
  201.     +-----------------------+-------+-----------------------+
  202.      24  23  22  21  20  19          18  17  16  15  14  13
  203.  
  204.                           Black's Side
  205.  
  206. In  this case, black could move to 21, 18, or 10, bumping one  of 
  207. these players to the bar. Black could also move to any unoccupied 
  208. number, or to any number occupied by more black players. However, 
  209. black  can not move to points 8 or 13, since these  have  greater 
  210. than one white player present on them already.
  211.  
  212. Likewise,  white  can  not occupy points 7, 12, 16,  17,  or  19. 
  213. However,  he could bump the player at point 14 onto the  bar.  At 
  214. that  time,  black would have to move the man from the  bar  onto 
  215. one of points 1 to 6, prior to making another move.
  216.  
  217. Eventually, black and/or white will have moved all of his players 
  218. onto the inner table, and they can then be taken off the board. 
  219.  
  220.                           White's Side
  221.  
  222.       1   2   3   4   5   6           7   8   9  10  11  12
  223.     +-----------------------+-------+-----------------------+
  224.     |     W   W   W       W |       |     W                 |
  225.     |     W   W   W       W |       |                       |
  226.     |     W   W   W         |       |                       |
  227.     |     W   W             |       |                       |
  228.     |         W             |       |                       |
  229.     |                       |       |                       |
  230.     |                       |       |                       |
  231.     |                       |       |                       |
  232.     |         B       b     |       |                       |
  233.     | B       B       B   B |       |                       |
  234.     | B   b   B       B   B |       |                       |
  235.     | B   B   B       B   B |       |                       |
  236.     +-----------------------+-------+-----------------------+
  237.      24  23  22  21  20  19          18  17  16  15  14  13
  238.  
  239.                           Black's Side
  240.  
  241. Suppose  black rolls a 2 and a 5 on the dice; the  players  above 
  242. which  are  in  lower case can be removed.  Other  options  would 
  243. include moving a man from point 19 to point 24 (5 points), moving 
  244. one player from 22 to 24, etc. In this situation, many moves  are 
  245. possible,  but  it is usually desirable to take players  off  the 
  246. board  if you can. 
  247.  
  248. In  the above configuration, white must first move his  man  from 
  249. the 8 point into his inner table. Only then can white players  be 
  250. taken  off of the board. Chances are, a roll like 2, 3  would  be 
  251. used  to move the player at 8 to 6, and the player at 3  off  the 
  252. table.
  253.  
  254. This, in a nutshell, is the essence of basic backgammon. Needless 
  255. to  say,  there is a complicating factor, and it  is  called  the 
  256. doubling  cube.  The  doubling cube normally sits  right  in  the 
  257. middle  of  the bar, and has a number 1 on it. Scoring  in  back-
  258. gammon  is by wins, and the doubling cube indicates the value  in 
  259. wins  that  this current game represents. If  the  doubling  cube 
  260. shows a 1, then this game is worth 1 win.
  261.  
  262. When  the  doubling cube is in the center of  the  board,  either 
  263. player  may double. However, if the cube is on the other side  of 
  264. the board from a player, then that player may not double. Control 
  265. of  the  cube  goes  back and forth from that  point  on.  As  an 
  266. example, suppose white doubled initially. Then black would be the 
  267. only  player able to double later in the game. If he  does,  then 
  268. white can double again, and so on.
  269.  
  270. To  double  the value of a game, the player  states  that  he/she 
  271. wishes  to double. This must be done before rolling the dice  for 
  272. that  turn. The opponent has the option of  accepting,  whereupon 
  273. the  game  proceeds  at twice the stakes, or  declining.  If  the 
  274. player  chooses  the  latter, then the  doubling  player  is  the 
  275. immediate winner of the game.
  276.  
  277.  
  278.                         Playing with BKG
  279.  
  280. Operation  of  the  BKG  program  is  relatively  simple.   After 
  281. executing  BKG  from a command prompt, the program  asks  you  to 
  282. press  return;  this seeds the random number generator.  At  that 
  283. point you have the option of playing white or black. In the cases 
  284. represented  here, I assume that the human plays black,  and  the 
  285. computer plays white.
  286.  
  287. The screen, on either the Kaypro or the PC, should draw a playing 
  288. table  similar to the ones outlined in this text. If you  have  a 
  289. color monitor on your PC, then the board is in color; otherwise a 
  290. monochrome monitor works just as well. There are two "dice" drawn 
  291. in the upper-right corner of the screen. These represent the dice 
  292. for the game. Also note that there is a doubling cube represented 
  293. by a box in the center of the screen. Since no player has doubled 
  294. at the beginning of a game, it is in the center and shows a '1'.
  295.  
  296. When the game starts, one die is rolled by each opponent, and the 
  297. player  with the higher roll starts with that roll.  (Variations, 
  298. including  automatic doubling when doubles are rolled, are not  a 
  299. part of the standard rules, and are not included.) Suppose  black 
  300. wins this initial roll, and that the dice show six and one:
  301.  
  302.  
  303.       1   2   3   4   5   6           7   8   9  10  11  12
  304.     +-----------------------+-------+-----------------------+
  305.     | B                   W |       |     W               B |
  306.     | B                   W |       |     W               B |
  307.     |                     W |       |     W               B |
  308.     |                     W |       |                     B |
  309.     |                     W | +---+ |                     B |
  310.     |                       | | 1 | |                       |
  311.     |                       | +---+ |                       |
  312.     |                     B |       |                     W |
  313.     |                     B |       |                     W |
  314.     |                     B |       |     B               W |
  315.     | W                   B |       |     B               W |
  316.     | W                   B |       |     B               W |
  317.     +-----------------------+-------+-----------------------+
  318.      24  23  22  21  20  19          18  17  16  15  14  13
  319.  
  320.     Black rolls a 6, 1 and gets to start.
  321.     Your move:
  322.  
  323. This is a good roll to get for black, because he can make his  18 
  324. point  by moving someone from the 12 point 6 places, and  someone 
  325. from the 17 point 1 point. To do this, enter the following at the 
  326. prompt:
  327.  
  328.     Your move: 12/6 17/1
  329.  
  330. The slash is used to separate the source point from the  distance 
  331. desired.  Entering "17/1 12/6" would have the same result  -  the 
  332. order is not important in this case. 
  333.  
  334. Just  for  your reference, here are some of  the  other  possible 
  335. moves, and the representation for each:
  336.  
  337.     Your move: 1/1 1/6
  338.     Your move: 17/6 17/1
  339.     Your move: 12/6 1/1
  340.     Your move: 19/1 1/6
  341.     Your move: 12/6 18/1                (but not 12/1 13/6)
  342.     Your move: 12/6/1                   (but not 12/1/6)
  343.  
  344. The last two examples accomplish the same result; the second is a 
  345. shorthand  for the first. In any case, the playing  board  should 
  346. look like this:
  347.  
  348.  
  349.       1   2   3   4   5   6           7   8   9  10  11  12
  350.     +-----------------------+-------+-----------------------+
  351.     | B                   W |       |     W               B |
  352.     | B                   W |       |     W               B |
  353.     |                     W |       |     W               B |
  354.     |                     W |       |                     B |
  355.     |                     W | +---+ |                       |
  356.     |                       | | 1 | |                       |
  357.     |                       | +---+ |                       |
  358.     |                     B |       |                     W |
  359.     |                     B |       |                     W |
  360.     |                     B |       |                     W |
  361.     | W                   B |       | B   B               W |
  362.     | W                   B |       | B   B               W |
  363.     +-----------------------+-------+-----------------------+
  364.      24  23  22  21  20  19          18  17  16  15  14  13
  365.  
  366.  
  367.     Black rolls a 6, 1 and gets to start.
  368.     Your move: 12/6 17/1
  369.  
  370. Now, white (the BKG program) will roll the dice. Suppose it rolls 
  371. a one and three. It might make the following move:
  372.  
  373.  
  374.       1   2   3   4   5   6           7   8   9  10  11  12
  375.     +-----------------------+-------+-----------------------+
  376.     | B               W   W |       |     W               B |
  377.     | B               W   W |       |     W               B |
  378.     |                     W |       |                     B |
  379.     |                     W |       |                     B |
  380.     |                       | +---+ |                     B |
  381.     |                       | | 1 | |                       |
  382.     |                       | +---+ |                       |
  383.     |                     B |       |                     W |
  384.     |                     B |       |                     W |
  385.     |                     B |       |     B               W |
  386.     | W                   B |       |     B               W |
  387.     | W                   B |       |     B               W |
  388.     +-----------------------+-------+-----------------------+
  389.      24  23  22  21  20  19          18  17  16  15  14  13
  390.  
  391.     White rolls a 1, 3 and moves 8/3 6/1
  392.  
  393.     Return to roll:
  394.  
  395. White,  since it is the computer, makes its moves  automatically, 
  396. of course. 
  397.  
  398. Note  that the dice are not rolled for you once the opponent  has 
  399. completed  his  move. This is because you may wish to  double  at 
  400. this  point. You could just roll the dice by hitting  return,  or 
  401. you  can type "double" (or just "d"). This is similar  to  asking 
  402. the  person  across the table if he will take a  double  at  that 
  403. point.  The  BKG program will either accept, by saying  "yes"  or 
  404. decline, and lose the game.
  405.  
  406. The  "return to roll" prompt also allows you to quit the game  by 
  407. typing "quit".
  408.  
  409. Suppose  you press return, and roll a double-five. Some  of  your 
  410. options at this point are:
  411.  
  412.     Your move: 12/5 12/5 12/5 12/5
  413.     Your move: 12/5 12/5 17/5 17/5
  414.     Your move: 12/5/5 12/5/5             (same as previous example)
  415.  
  416. Note  that  the black players at point one and point 19  can  not 
  417. move,  since there are more than two white players  exactly  five 
  418. points away.
  419.  
  420. Let's move "12/5/5 12/5/5", resulting in:
  421.  
  422.  
  423.       1   2   3   4   5   6           7   8   9  10  11  12
  424.     +-----------------------+-------+-----------------------+
  425.     | B               W   W |       |     W               B |
  426.     | B               W   W |       |     W               B |
  427.     |                     W |       |                     B |
  428.     |                     W |       |                       |
  429.     |                       |       |                       |
  430.     |                       | +---+ |                       |
  431.     |                       | | 1 | |                       |
  432.     |                     B | +---+ |                     W |
  433.     |                     B |       |                     W |
  434.     |                     B |       |     B               W |
  435.     | W       B           B |       |     B               W |
  436.     | W       B           B |       |     B               W |
  437.     +-----------------------+-------+-----------------------+
  438.      24  23  22  21  20  19          18  17  16  15  14  13
  439.  
  440.     White rolls a ...
  441.  
  442.     Return to roll:
  443.  
  444. Play   alternates  back  and  forth  in  this  manner,  until   a 
  445. complication occurs:
  446.  
  447.       1   2   3   4   5   6           7   8   9  10  11  12
  448.     +-----------------------+-------+-----------------------+
  449.     |                 W   W |       | B   W   W   B       B |
  450.     |                 W   W |       |     W   W           B |
  451.     |                     W |       |         W             |
  452.     |                     W |       |                       |
  453.     |                       |       |                       |
  454.     |                       | +---+ |                       |
  455.     |                       | | 1 | |                       |
  456.     |                       | +---+ |                       |
  457.     |                     B |       |                       |
  458.     |                     B |       |     B               W |
  459.     |         B           B |       |     B               W |
  460.     |         B   B       B |       | B   B   W           W |
  461.     +-----------------------+-------+-----------------------+
  462.      24  23  22  21  20  19          18  17  16  15  14  13
  463.  
  464.     White doubles. Do you accept?
  465.  
  466. You  have  the  option at this time of  either  typing  'Y',  and 
  467. proceeding  on twice the stakes, or declining by typing  'N'  and 
  468. losing  this game. Suppose we accept; then the cube is  given  to 
  469. our  side,  and the computer player is not able to  double  until 
  470. after we do. We have "control" of the cube:
  471.  
  472.       1   2   3   4   5   6           7   8   9  10  11  12
  473.     +-----------------------+-------+-----------------------+
  474.     |                 W   W |       | B   W   W   B       B |
  475.     |                 W   W |       |     W   W           B |
  476.     |                     W |       |         W             |
  477.     |                     W |       |                       |
  478.     |                       |       |                       |
  479.     |                       |       |                       |
  480.     |                       |       |                       |
  481.     |                       |       |                       |
  482.     |                     B |       |                       |
  483.     |                     B | +---+ |     B               W |
  484.     |         B           B | | 1 | |     B               W |
  485.     |         B   B       B | +---+ | B   B   W           W |
  486.     +-----------------------+-------+-----------------------+
  487.      24  23  22  21  20  19          18  17  16  15  14  13
  488.  
  489.     White rolls double threes, 
  490.  
  491. White  has rolled a lucky double, and he moves "13/3/3 6/3  6/3". 
  492. This  has  the unfortunate aspect of knocking two  black  players 
  493. onto the bar:
  494.  
  495.       1   2   3   4   5   6           7   8   9  10  11  12
  496.     +-----------------------+-------+-----------------------+
  497.     |         W       W   W |       | W   W   W           B |
  498.     |         W       W   W |  B B  |     W   W           B |
  499.     |                       |       |         W             |
  500.     |                       |       |                       |
  501.     |                       |       |                       |
  502.     |                       |       |                       |
  503.     |                       |       |                       |
  504.     |                       |       |                       |
  505.     |                     B |       |                       |
  506.     |                     B | +---+ |     B               W |
  507.     |         B           B | | 1 | |     B               W |
  508.     |         B   B       B | +---+ | B   B   W           W |
  509.     +-----------------------+-------+-----------------------+
  510.      24  23  22  21  20  19          18  17  16  15  14  13
  511.  
  512.     White rolls double threes, and moves 13/3 10/3 6/3 6/3
  513.     Return to roll:
  514.  
  515. Suppose  we press return, and roll a three and a four. The  rules 
  516. of  play  specifically forbid a player from moving on  the  board 
  517. until all of that players men are off of the bar. In the case  of 
  518. this roll, we can not put both men onto the table, because  point 
  519. number three is occupied. Thus, we can only make one move: 
  520.  
  521.       1   2   3   4   5   6           7   8   9  10  11  12
  522.     +-----------------------+-------+-----------------------+
  523.     |         W   B   W   W |       | W   W   W           B |
  524.     |         W       W   W |  B    |     W   W           B |
  525.     |                       |       |         W             |
  526.     |                       |       |                       |
  527.     |                       |       |                       |
  528.     |                       |       |                       |
  529.     |                       |       |                       |
  530.     |                       |       |                       |
  531.     |                     B |       |                       |
  532.     |                     B | +---+ |     B               W |
  533.     |         B           B | | 1 | |     B               W |
  534.     |         B   B       B | +---+ | B   B   W           W |
  535.     +-----------------------+-------+-----------------------+
  536.      24  23  22  21  20  19          18  17  16  15  14  13
  537.  
  538.     White rolls double threes, and moves 13/3 10/3 6/3 6/3
  539.     Your move: b/4
  540.  
  541. When  moving  off  of the bar/ specify "b"  as  the  source,  and 
  542. specify the distance as you normally would. 
  543.  
  544. Suppose we had rolled a three and six. Then we would have nothing 
  545. we could play, and it is immediately white's turn again. This  is 
  546. checked automatically. Also, we can not move "b/3 18/4",  because 
  547. of the above rules.
  548.  
  549. Play  continues  in  this way until near the  end  of  the  game. 
  550. Suppose we are just about finished:
  551.  
  552.       1   2   3   4   5   6           7   8   9  10  11  12
  553.     +-----------------------+-------+-----------------------+
  554.     | W   W   W   W   W   W |       |                       |
  555.     | W   W   W   W   W     |       |                       |
  556.     | W   W       W         |       |                       |
  557.     |             W         |       |                       |
  558.     |                       |       |                       |
  559.     |                       |       |                       |
  560.     |                       |       |                       |
  561.     |                       |       |                       |
  562.     |     B               B |       |                       |
  563.     |     B               B | +---+ |                       |
  564.     |     B   B       B   B | | 1 | |                       |
  565.     |     B   B   B   B   B | +---+ | B   B                 |
  566.     +-----------------------+-------+-----------------------+
  567.      24  23  22  21  20  19          18  17  16  15  14  13
  568.  
  569.     White rolls double threes, and moves 13/3 10/3 6/3 6/3
  570.     Return to roll:
  571.  
  572. At this point we have little we can do except for taking the  men 
  573. off  of points 17 and 18 and into the inner table. Remember,  you 
  574. must have all players in this area before removing them from  the 
  575. board. Removing players is exactly the same as moving them around 
  576. the board. 
  577.  
  578. Once  the players on 17 and 18 are taken to the left, suppose  we 
  579. roll  double fours. We could then move something like "21/4  19/4 
  580. 19/4  19/4".  The man on point 21 is gone - he has  been  removed 
  581. from the table. The first one to remove all men is the winner.
  582.  
  583. Note  that  in backgammon, if you have removed all  of  your  men 
  584. prior to the opponent getting all of his men to his inner  table, 
  585. then  you  win  twice the value of the game.  This  is  called  a 
  586. gammon.  When you win a gammon and the game has doubled back  and 
  587. forth, you win twice the number shown on the cube.
  588.  
  589. The  ultimate  disgrace  is to  backgammon  your  opponent.  This 
  590. happens when you have removed all of your players from the table, 
  591. but  the opponent has players left in your inner table.  This  is 
  592. rather  rare,  but  is worth three times the value  of  the  game 
  593. should it happen.
  594.  
  595.  
  596.                        About the Software
  597.  
  598. The system consists of the following files:
  599.  
  600.         BKG.C           - This is the main routine for the  back-
  601.                           gammon player.
  602.  
  603.         EVAL.C          - These routines are the heuristics  used 
  604.                           to make semi-intelligent moves. When to 
  605.                           double  and not double is also included 
  606.                           in here.
  607.  
  608.         IBMUTILS.C      - These are utility functions for running 
  609.                           on  the IBM PC or clone. Link these  in 
  610.                           when  running  on a PC, and  leave  out 
  611.                           Kayutils.
  612.  
  613.         KAYUTILS.C      - This  file contains the  utilities  for 
  614.                           drawing on the Kaypro screen. You  link 
  615.                           in  these utilities when running  on  a 
  616.                           Kaypro with CP/M.
  617.  
  618.         MOVE.C          - This handles removing a player from the 
  619.                           board,  and putting him in a  different 
  620.                           place. 
  621.  
  622.         MOVEGEN.C       - This is the move generator. It takes  a 
  623.                           board configuration, and what the  dice 
  624.                           show, and generates all possible  moves 
  625.                           given that board and roll.
  626.  
  627.         BKG.H           - This   file   contains   all   of   the 
  628.                           (unfortunate) globals and #define's for 
  629.                           the rest of the software. This file  is 
  630.                           included everywhere else.
  631.  
  632.         BKG.TXT         - You're reading it.
  633.  
  634.         BKG.PRN         - In case you don't have NewWord or Word-
  635.                           star.
  636.  
  637.  
  638. These are designed to be compiled and run on a Kaypro with graph-
  639. ics,  using the BDS C compiler, or on an IBM PC clone  using  the 
  640. Computer  Innovations  C86  compiler.  There  are  two  computer-
  641. dependent libraries that need to be compiled and linked with  the 
  642. rest of the source. "Kayutils.c" is the utility file fur  running 
  643. on the Kaypro computers. "Ibmutils.c" contains the same routines, 
  644. but is PC dependent for the PC clones. (You wouldn't buy the real 
  645. thing, now, would you?)
  646.  
  647. Compile each of the C source files. Then link them. Under BDS C I 
  648. use the L2 linker instead of CLINK, but each works equally well:
  649.  
  650.         A0>L2 bkg movegen move screen eval -l kayutils
  651.  
  652. or      
  653.  
  654.         A0>clink bkg movegen move screen eval kayutils
  655.  
  656. To link code compiled with the C86 compiler, note that the  small 
  657. model  can/should  be used to compile all of  the  source  files. 
  658. Then:
  659.  
  660.         A>link bkg+movegen+move+screen+eval+ibmutils,,,ibmpcs+c86s2s
  661.  
  662. using the IBM linker.
  663.  
  664.  
  665.                              Lastly,
  666.  
  667. The  rules  used to implement this game are found in  "The  Back-
  668. gammon  Book" by Oswald Jacoby and John Crawford. This  was  also 
  669. the  source  for some of the heuristics concerning  the  doubling 
  670. cube. I found this book at my local B. Daltons, of course.
  671. he  source  for some of the h